/**
 * 	write on 2005-10-26 10:17:18.
 */
package org.nanhill.commons.http;

import java.util.HashMap;
import java.util.Map;

/**
 * @author alin
 * 
 */
public class HttpHeader {
	/** The content type for an Excel response */
	public static final String CONTENT_TYPE_EXCEL = "application/vnd.ms-excel";

	public static final String CONTENT_TYPE_HTML = "text/html;charset=UTF-8";

	public static final String METHOD_POST = "POST";

	public static final String METHOD_GET = "GET";

	public static final String ACCEPT_LANGUAGE = "Accept-Language";

	private static Map<String, String> langCharSetMap;

	static {
		langCharSetMap = new HashMap<String, String>();
		langCharSetMap.put("zh-cn", "GBK");
		langCharSetMap.put("zh-tw", "BIG5");
		langCharSetMap.put("jp", "SJIS");
		langCharSetMap.put("jp", "SJIS");
	}

	public static String getDefaultCharSet(String acceptLanguage) {
		String charSet = langCharSetMap.get(acceptLanguage);
		if (charSet == null)
			charSet = "ISO-8859-1";
		return charSet;
	}
}
